<%--
  Created by IntelliJ IDEA.
  User: hellcat
  Date: 2020/2/24
  Time: 13:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@include file="extra/body.jsp" %>
<%--start--%>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">超市信息管理
                    <shiro:hasPermission name="store:haveNoStore">
                        <button type="button" class="layui-a-tips layui-btn layui-btn-warm layui-btn-sm"
                                id="storeInsert">
                            创建超市
                        </button>
                    </shiro:hasPermission>
                </div>
                <div class="layui-card-body">
                    <shiro:hasPermission name="store:haveStore">
                        <div class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">超市编号:</label>
                            <div class="layui-input-inline">
                                <input type="text" value="${storeInfo.id}"
                                       class="layui-input" id="storeId" readonly style="border: none">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">超市名称:</label>
                            <div class="layui-input-inline">
                                <input type="text" value="${storeInfo.storeName}"
                                       class="layui-input" id="storeName" readonly style="border: none">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">所在地区:</label>
                            <div class="layui-input-inline">
                                <input type="text" value="${storeInfo.location}" data-id="${storeInfo.locationId}"
                                       class="layui-input" id="storeLocation" readonly style="border: none">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">详细地址:</label>
                            <div class="layui-input-inline">
                                <input type="text" value="${storeInfo.detailedAddress}"
                                       class="layui-input" id="storeDetailedAddress" readonly style="border: none">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">联系人:</label>
                            <div class="layui-input-block">
                                <input type="text" value="${storeInfo.contacts}"
                                       class="layui-input" id="storeContacts" readonly style="border: none">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">联系电话:</label>
                            <div class="layui-input-block">
                                <input type="text" value="${storeInfo.phone}"
                                       class="layui-input" id="storePhone" readonly style="border: none">
                            </div>
                        </div>
                        <shiro:hasPermission name="store:updateStore">
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button id="storeInfoUpdate" type="button" class="layui-btn  layui-btn-normal">修改信息
                                    </button>
                                </div>
                            </div>
                            </div>
                        </shiro:hasPermission>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="store:haveNoStore">
                        请先创建超市!
                    </shiro:hasPermission>
                </div>
            </div>
        </div>
    </div>
</div>


<%--end--%>
</div>
</div>
<div id="storeEdit" class="layui-hide">
    <div class="layui-form">
        <form id="storeInfoForm" lay-filter="storeInfoForm" class="layui-form" autocomplete="off"
              style="margin-top: 20px;">
            <div class="layui-form-item">
                <label class="layui-form-label">超市编号:</label>
                <div class="layui-input-inline">
                    <input type="text" name="id" class="layui-input" readonly style="border: none">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">超市名称:</label>
                <div class="layui-input-inline">
                    <input type="text" name="storeName" class="layui-input" lay-verify="required">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">所在地区:</label>
                <input type="hidden" id="location" name="location"/>

            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">详细地址:</label>
                <div class="layui-input-inline">
                    <input type="text" name="detailedAddress" class="layui-input" lay-verify="required">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">联系人:</label>
                <div class="layui-input-inline">
                    <input type="text" name="contacts" class="layui-input" lay-verify="required">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">联系方式:</label>
                <div class="layui-input-inline">
                    <input type="tel" name="phone" class="layui-input" lay-verify="phone">
                </div>
            </div>
        </form>
    </div>
</div>
<div id="storeAdd" class="layui-hide">
    <div class="layui-form">
        <form id="storeAddInfoForm" lay-filter="storeAddInfoForm" class="layui-form" autocomplete="off"
              style="margin-top: 20px;">
            <div class="layui-form-item">
                <label class="layui-form-label">超市名称:</label>
                <div class="layui-input-inline">
                    <input type="text" name="storeName" class="layui-input" lay-verify="required">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">所在地区:</label>
                <input type="hidden" id="locationAdd" name="location"/>

            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">详细地址:</label>
                <div class="layui-input-inline">
                    <input type="text" name="detailedAddress" class="layui-input" lay-verify="required">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">联系人:</label>
                <div class="layui-input-inline">
                    <input type="text" name="contacts" class="layui-input" lay-verify="required">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">联系方式:</label>
                <div class="layui-input-inline">
                    <input type="tel" name="phone" class="layui-input" lay-verify="phone">
                </div>
            </div>
        </form>
    </div>
</div>

<script src="../static/js/store.js"></script>

<%@include file="extra/footer.jsp" %>

